package com.bowen.demo.demo003.controller;

import com.bowen.demo.demo003.request.CbsFrontEndLogRequest;
import com.bowen.demo.demo003.result.CbsFrontEndLogResult;
import com.bowen.demo.demo003.result.CbsResult;
import com.bowen.demo.demo003.service.CbsFrontEndMonitorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 日志查询Controller
 * 公众号【猿码天地】
 */
@Slf4j
@RestController
public class CbsFrontEndLogController {
	public static final String REQUSET_MODEL = "/frontEndLog";

    @Autowired
    private CbsFrontEndMonitorService cbsFrontEndMonitorService;

    @RequestMapping(value = REQUSET_MODEL + "/list", method = RequestMethod.POST, produces= MediaType.APPLICATION_JSON_UTF8_VALUE)
    public CbsResult<List<CbsFrontEndLogResult>> showFrontEndLog(@RequestBody CbsFrontEndLogRequest request, HttpServletRequest httpServletRequest)
			throws Exception {
        return cbsFrontEndMonitorService.showFrontEndLog(request);
    }

}
